// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import ViewUI from 'view-design'
import i18n from '@/locale'
import config from '@/config'
import importDirective from '@/directive'
import { checkPermissionO } from '@/directive/module/permission'
// import { directive as clickOutside } from 'v-click-outside-x'
import installPlugin from '@/plugin'
import { message } from '@/libs/message'
// import 'view-design/dist/styles/iview.css'
import '@/assets/iview.css'
import './index.less'
import '@/assets/icons/iconfont.css'
// import '@/assets/custom/iconfont.css'

/**
 *  @description  测试状态下加载mock
 */
// if (config.isDebug) {
//   require('@/mock')
// }

Vue.use(ViewUI, {
	i18n: (key, value) => i18n.t(key, value)
})
/**
 * @description 注册admin内置插件
 */
installPlugin(Vue)
/**
 * @description 生产环境关掉提示
 */
Vue.config.productionTip = false
/**
 * @description 全局注册应用配置
 */
Vue.prototype.$config = config
/**
 * 注册指令
 */
importDirective(Vue)
// Vue.directive('clickOutside', clickOutside)
Vue.prototype.$permission = checkPermissionO
window.message = message
/* eslint-disable no-new */
new Vue({
	el: '#app',
	router,
	store,
	i18n,
	render: (h) => h(App)
})
